import { defineStore } from "pinia";
export const pageStore = defineStore("common", {
  state: () => {
    return {
      showBasic: true,
      selectWg: {}, // 当前选中
      dragWg: {},
      pageData: {
        title: "", //标题
        share_title: "", //分享标题
        share_img: "", //分享图片
        share_content: "", //分享内容
        bg_color: "#fff", //背景颜色
        header_color: "#000", //标题颜色
        header_bg: "#fff", //标题背景颜色
        content: [], // 内容
      },
    };
  },
  actions: {
    setPageData(data) {
      this.pageData = data;
    },
    setSelectWg(data) {
      this.selectWg = data;
    },
    setDragWg(data) {
      this.dragWg = data;
    },
    setShowBasic(data) {
      this.showBasic = data;
    },
  },
  persist: {
    // enabled: true,
    // strategies: [
    //   {
    //     key: "page",
    //     storage: localStorage,
    //   },
    // ],
  },
});
